-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add support for poll watcher #21290
feat(cli): add support for poll watcher #21290
Conversation
3773b14
to
ae66312
Compare
4c926d0
to
1802ece
Compare
Co-authored-by: Jorge Hermo <[email protected]>
Hey @amribm, thank you for this PR!
|
okay, i will add changelog
Yes This is ready for review , @pront i need some confirmation from vector team for those comments. that's why i didn't resolved them. |
Co-authored-by: Pavlos Rontidis <[email protected]>
Co-authored-by: Pavlos Rontidis <[email protected]>
Co-authored-by: Pavlos Rontidis <[email protected]>
… and docs update
Co-authored-by: Jorge Hermo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment (TIOLI). Also, waiting for a documentation review. Otherwise, this is good to go 🚀
@@ -19,11 +22,49 @@ const CONFIG_WATCH_DELAY: std::time::Duration = std::time::Duration::from_secs(1 | |||
|
|||
const RETRY_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10); | |||
|
|||
/// Refer to [`crate::cli::WatchConfigMethod`] for details. | |||
pub enum WatcherConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can refactor create_watcher
to use the WatchConfigMethod
enum directly. AFAIK, due to clap parsing, the WatchConfigMethod
needs to have plain enum variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since i want that enum to have values about the interval and i don't want to pass the interval in the function parameters.
One thing we can do is we can eliminate is watch config method enum. we can make it as string and add the possible values for clap
arguments. using that we can create the WatcherConfig
enum
Co-authored-by: Jorge Hermo <[email protected]>
} | ||
|
||
fn watch(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<(), Error> { | ||
use notify::Watcher as NotifyWatcher; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: any reason to use this here vs at the top like the other imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we already have name watcher as enum. it was colliding with watcher from notify
.
Renaming the import at the top level user might not able to understand what is NotifyWathcher
and we need the methods for notify::Watcher
on that specific scope. that's why i used Watcher on the specific scope
I think we addressed all open questions here? cc @amribm and @jorgehermo9 |
LGTM! |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Apologies, I didn't realize this got pushed out of the merge queue. |
When this PR will merge @pront? |
Signed-off-by: Jesse Szwedko <[email protected]>
It looks like there were cue formatting issues blocking merge as the failed CI check shows. I formatted and pushed though so I think this should merge soon if there are no other failing checks. |
Thanks again, this is a great contribution 🚀 |
Thank you guys, this is my first open-source contribution. thanks for making this possible. @jorgehermo9 @pront @brittonhayes |
Closes #21111